﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ucSearch.ascx.cs" Inherits="ucControl_ucSearch" %>

<script>

    $(document).ready(function() {

        //move the image in pixel
        var move = -15;

        //zoom percentage, 1.2 =120%
        var zoom = 1.2;

        //On mouse over those thumbnail
        $('.item').hover(function() {

            //Set the width and height according to the zoom percentage
            width = $('.item').width() * zoom;
            height = $('.item').height() * zoom;

            //Move and zoom the image
            $(this).find('img').stop(false, true).animate({ 'width': width, 'height': height, 'top': move, 'left': move }, { duration: 200 });

            //Display the caption
            $(this).find('div.caption').stop(false, true).fadeIn(400);
        },
	function() {
	    //Reset the image
	    $(this).find('img').stop(false, true).animate({ 'width': $('.item').width(), 'height': $('.item').height(), 'top': '0', 'left': '0' }, { duration: 100 });

	    //Hide the caption
	    $(this).find('div.caption').stop(false, true).fadeOut(400);
	});

    });

</script>

<style>
    .item
    {
        width: 160px;
        height: 160px;
        overflow: hidden;
        position: relative;
        float: left;
    }
    .item img
    {
        position: absolute;
    }
    .clear
    {
        clear: both;
    }
</style>
<!-- end rê chuột phóng to hình -->
<style>
    .search
    {
        background: #f5f5f5;
        border: 1px solid #ddd;
        height: 40px;
        line-height: 40px;
    }
    .s_gia
    {
        width: 180px;
        float: left;
        padding-left: 10px;
    }
    .sap_xep
    {
        width: 200px;
        float: left;
        padding-left: 10px;
    }
    .sap_xep1
    {
        width: 50px;
        float: left;
        padding-left: 8px;
    }
    .s_kiem input
    {
        background: none repeat scroll 0 0 #F3AB25;
        border-radius: 8px 0 8px 0;
        color: white;
        padding: 3px 6px;
    }
    .s_kiem
    {
        width: 100px;
        float: left;
        padding-left: 5px;
        padding-top: 6px;
    }
    .search span
    {
        background: #F3AB25;
        border-radius: 8px 0 8px 0;
        color: white;
        padding: 6px;
    }
</style>
<div class="sanpham">
    <div class="next_pre">
        <h1>
            <asp:Label ID="lbTen" runat="server" Text="Label"></asp:Label>
        </h1>
    </div>
    <div class="search">
        <div class="s_gia">
            Giá từ :<asp:DropDownList ID="drPriceFrom" runat="server">
            </asp:DropDownList>
        </div>
        <div class="s_gia">
            Giá đến :
            <asp:DropDownList ID="drPriceTo" runat="server">
            </asp:DropDownList>
        </div>
        <div class="s_kiem">
            <asp:Button ID="Button1" runat="server" Text="Tìm kiếm" OnClick="Button1_Click" />
        </div>
        <div class="sap_xep">
            Sắp xếp theo :
            <asp:DropDownList ID="drFilter" runat="server">
                <asp:ListItem Value="ItemName" Text="Tên Sản Phẩm"></asp:ListItem>
                <asp:ListItem Value="BaseSellingPrice" Text="Giá"></asp:ListItem>
            </asp:DropDownList>
        </div>
        <div class="sap_xep1">
            <asp:ImageButton ID="btnSortedAsc" runat="server" Style="border-width: 0px; height: 16px;
                margin-top: 11px" ToolTip="Ascending" OnClick="btnSortedAsc_Click" ImageUrl="~/img/quantityUp.png" />
            <asp:ImageButton ID="btnSortDesc" runat="server" Style="border-width: 0px; 
                height: 16px; margin-top: 11px" ToolTip="Desceding" Width="16px" OnClick="btnSortDesc_Click"
                ImageUrl="~/img/quantityDn.png" />
        </div>
    </div>
    <div class="boxContentW">
        <asp:ListView runat="server" ID="lvItems" ItemPlaceholderID="groupPlaceholder" GroupItemCount="3"
            GroupPlaceholderID="layoutTemplate" OnPagePropertiesChanged="lvItems_PagePropertiesChanged">
            <LayoutTemplate>
                <table id="layoutTemplate" runat="server" border="0" cellpadding="0" cellspacing="0">
                </table>
            </LayoutTemplate>
            <GroupTemplate>
                <tr>
                    <div id="groupPlaceholder" runat="server">
                    </div>
                </tr>
            </GroupTemplate>
            <ItemTemplate>
                <td style="padding: 10px 0 15px 0px;">
                   
                        <div class="imgContent"  price='<%# Eval("BaseSellingPrice") %>' matchedprice='0'
                            code='<%# Eval("ItemID") %>'>
                            <table style="width:170px;"  border="0" cellspacing="0" cellpadding="0">
                                <tr>
                                    <td class="imgW" align="center" style="padding: 0px; height: 200px">
                                        <table style="width:170px;" border="0" cellspacing="0" cellpadding="5">
                                            <tr>
                                                <td class="img_border">
                                                    <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# "~/Chi-tiet-san-pham.aspx?id=" + Eval("ItemID")+ "&idgroup="+Eval("IDGroup")  %>'>
                                                        <div class="item">
                                                            <asp:Image ID="img" runat="server" ImageUrl='<%# "~/ImageProcess.ashx?file=" + "~/Admin/img/Items/" + Eval("ImageURL") + "&width=160&heigh=160&dd=true" %>'
                                                                AlternateText="No Image" /></div>
                                                    </asp:HyperLink>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    <p>
                                                        <%# Eval("ItemName") %>
                                                    </p>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    <div class="line4">
                                                    </div>
                                                    <p class="textR1">
                                                        <strong>
                                                            <%# double.Parse (Eval("BaseSellingPrice").ToString()).ToString("0,00.##") %>
                                                            VNĐ </strong>
                                                    </p>
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                                <tr>
                                    <td align="center">
                                        <!--class="bnt_dathang"-->
                                        <table border="0" cellspacing="3" cellpadding="0">
                                            <tr>
                                                <td width="1">
                                                    <asp:HyperLink ID="lnk" runat="server" NavigateUrl='<%# "~/Chi-tiet-san-pham.aspx?id=" + Eval("ItemID")+ "&idgroup=" + Eval("IDGroup")  %>'>
                                                        <asp:Image ID="Image3" runat="server" ImageUrl="~/images/chitiet.png" />
                                                    </asp:HyperLink>
                                                </td>
                                                <td>
                                                </td>
                                                <td width="1">
                                                    <asp:HyperLink ID="HyperLink2" runat="server" NavigateUrl='' ToolTip="Thêm vào giỏ hàng">
                                                        <asp:Image ID="Image1" runat="server" ImageUrl="~/images/dathang.png" onclick='<%#string.Format("fn_AddToCart(\"{0}|{1}|{2}\")", Eval("ItemID").ToString(), Eval("BaseSellingPrice").ToString(),"0")%>' />
                                                    </asp:HyperLink>
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                            </table>
                        </div>
                   
                </td>
            </ItemTemplate>
        </asp:ListView>
    </div>
</div>

<script language="javascript" type="text/javascript">
    function fn_AddToCart(productCodeAndPrice) {
        PageMethods.SetShoppingCartSesstion(productCodeAndPrice, SetShoppingCart);
    }
</script>

